package com.ziyun.erp.modules.order.service.impl;

import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.Map;
import com.baomidou.mybatisplus.mapper.EntityWrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import io.renren.common.utils.PageUtils;
import io.renren.common.utils.Query;

import com.ziyun.erp.modules.order.dao.UserPaymentBillDao;
import com.ziyun.erp.modules.order.entity.UserPaymentBillEntity;
import com.ziyun.erp.modules.order.service.UserPaymentBillService;


@Service("userPaymentBillService")
public class UserPaymentBillServiceImpl extends ServiceImpl<UserPaymentBillDao, UserPaymentBillEntity> implements UserPaymentBillService {

    @Override
    public PageUtils queryPage(Map<String, Object> params) {
        Page<UserPaymentBillEntity> page = this.selectPage(
                new Query<UserPaymentBillEntity>(params).getPage(),
                new EntityWrapper<UserPaymentBillEntity>()
        );

        return new PageUtils(page);
    }

    @Override
    public BigDecimal getTotalPayed(String orderId) {
        return baseMapper.getTotalPayed(orderId);
    }

}
